package ExceptionTest.test1_2;

public class CustomExceptionTest {
    public static void main(String[] args) {
        try {
            test();
        } catch (NullPointerException e){
            e.printStackTrace();
        }

        catch (UserNotEnoughException e) {
            int code = e.getCode();
            String msg = e.getMsg();
            System.out.println("code:" + code + ",msg:" + msg);
        }

    }

    public static void test() throws UserNotEnoughException
    {
        throw new UserNotEnoughException("自定义人员不够异常",-1);
    }
}
